package pl.ptemich.nov2k13.engine.configuration;

import java.io.InputStream;

import org.newdawn.slick.util.ResourceLoader;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.StaxDriver;

public class XmlConfigurationReader implements ConfigurationReader {

  @Override
  public GameConfiguration readConfiguration() {
    XStream xstream = new XStream(new StaxDriver());
    InputStream is = ResourceLoader.getResourceAsStream("resources/xml/gameConfiguration.xml");
    
    xstream.alias("gameConfiguration", GameConfiguration.class);
    //xstream.alias("phonenumber", PhoneNumber.class);
    
    GameConfiguration configuration = (GameConfiguration) xstream.fromXML(is);
    return configuration;
  }
  
}
